package com.gitee.kinbug.sso.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gitee.kinbug.sso.model.AuthUser;
import com.gitee.kinbug.sso.model.Result;

/**
 * @author BianPeng 2017-08-01 21:39:47
 */
@Controller
public class IndexController {

	@Value("${kinbug.sso.login-user}")
	private String loginUser;
	
    @RequestMapping("/")
    @ResponseBody
    public Result<AuthUser> index(HttpServletRequest request) {
    	AuthUser xxlUser = (AuthUser) request.getAttribute(loginUser);
        return new Result<AuthUser>(xxlUser);
    }

}